﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>JavaScript Client </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="JavaScript Client ">
    <meta name="generator" content="docfx 2.59.2.0">
    
    <link rel="shortcut icon" href="../../../../favicon.ico">
    <link rel="stylesheet" href="../../../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../../../styles/docfx.css">
    <link rel="stylesheet" href="../../../../styles/main.css">
    <link rel="stylesheet" href="../../../../styles/socialbar.css">
    <link rel="stylesheet" href="../../../../styles/header.css">
    <link rel="stylesheet" href="../../../../styles/version.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,100italic,300italic,400italic" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <meta property="docfx:navrel" content="../../../../toc.html">
    <meta property="docfx:tocrel" content="../../../toc.html">
    <meta property="docfx:uid" content="">
    
    <meta property="docfx:rel" content="../../../../">
    
    <script type="text/javascript" src="../../../../nav.js"></script>
    <script type="text/javascript" src="../../../toc.js"></script>
  
  </head>  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <div class="mb-socials-heading" style="height: 40px;">
        	<div class="mb-socials-heading-inner container">
        		<div class="mb-socials-heading-right">
        			<div class="mb-socials-list">
                          
        				<div class="mb-socials-item facebook">
        					<a class="mb-socials-item-link" target="_blank" href="https://facebook.com/embyapp"></a>
        					<div class="mb-socials-item-popup">
        						<span>Facebook</span>
        					</div>
        				</div><div class="mb-socials-item twitter">
        					<a class="mb-socials-item-link" target="_blank" href="https://twitter.com/embyapp"></a>
        					<div class="mb-socials-item-popup">
        						<span>Twitter</span>
        					</div>
        				</div>
        				<div class="mb-socials-item pinterest">
        					<a class="mb-socials-item-link" target="_blank" href="https://www.pinterest.com/emby0240/emby-news/"></a>
        					<div class="mb-socials-item-popup">
        						<span>Pinterest</span>
        					</div>
        				</div>
        				<div class="mb-socials-item tumblr">
        					<a class="mb-socials-item-link" target="_blank" href="https://embyapp.tumblr.com/"></a>
        					<div class="mb-socials-item-popup">
        						<span>Tumblr</span>
        					</div>
        				</div>
        				<div class="mb-socials-item github">
        					<a class="mb-socials-item-link" target="_blank" href="https://github.com/MediaBrowser"></a>
        					<div class="mb-socials-item-popup">
        						<span>GitHub</span>
        					</div>
        				</div><div class="mb-socials-item rss">
        					<a class="mb-socials-item-link" target="_blank" href="https://emby.media/blog.xml"></a>
        					<div class="mb-socials-item-popup">
        						<span>RSS</span>
        					</div>
        				</div>
                          
        			</div>
        		</div>
        	</div>
        </div>
        <div class="container">
        	<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
        		  
        		  <a class="navbar-brand" href="../../../../index.html">
        		    <img id="logo" class="svg" src="../../../../images/emby_dev_logo.png" alt="">
        		  </a>
        		  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
        			<span class="sr-only">Toggle navigation</span>
        			<span class="icon-bar"></span>
        			<span class="icon-bar"></span>
        			<span class="icon-bar"></span>
        		  </button>
        		<div class="collapse navbar-collapse" id="navbar">
        			
        			<ul class="nav level1 navbar-nav">
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../../../index.html" title="DEV Home">DEV Home</a>
        			      </li>
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../../../doc/index.html" title="Documentation">Documentation</a>
        			      </li>
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../../../reference/index.html" title="Reference">Reference</a>
        			      </li>
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../../../download/index.html" title="Download">Download</a>
        			      </li>
        			</ul>		</div>
        	</nav>
        </div>
        <div class="nav-overlay d-none"></div>        
        <div class="subnav navbar navbar-default">
          <div class="container">
            <div class="hide-when-search" id="breadcrumb">
        	  <ul class="breadcrumb">
        		<li></li>
        	  </ul>
        	</div>
        
        	<div class="breadcrumpsearch">
        	  <form class="navbar-form navbar-right" role="search" id="search">
        		<div class="form-group">
        		  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
        		</div>
        	  </form>
        	</div>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list">Search Results for <span></span></div>
          <div class="sr-items">
            <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
          </div>
          <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">
<h1 id="javascript-client">JavaScript Client</h1>

<table><tr></tr>
    <tr>
        <th valign="top" align="left">Name</th>
        <td>EmbyClient.JavaScript</td>
    </tr>
    <tr>
        <th valign="top" align="left">Language</th>
        <td>JavaScript</td>
    </tr>
    <tr>
        <th valign="top" align="left">SDK Folder</th>
        <td>SampleCode/RestApi/Clients/JavaScript</td>
    </tr>
</table>
<h2 id="installation">Installation</h2>
<h5 id="important">Important</h5>
<p>We do not recommend to use and install this code as a package. Probably too many adjustments will be required to get it working according to your requirements.<br>
A better approach is to use the code files directly in your project!</p>
<h3 id="for-nodejs">For <a href="https://nodejs.org/">Node.js</a></h3>
<h4 id="npm">npm</h4>
<p>To publish the library as a <a href="https://www.npmjs.com/">npm</a>,
please follow the procedure in <a href="https://docs.npmjs.com/getting-started/publishing-npm-packages">&quot;Publishing npm packages&quot;</a>.</p>
<div class="NOTE">
<h5>Note</h5>
<p>Please edit the package name to a custom name of yours before publishing anywhere!</p>
</div>
<p>Then install it via:</p>
<pre><code class="lang-shell">npm install EmbyClient.JavaScript --save
</code></pre>
<h4 id="git">git</h4>
<h1 id="section"></h1>
<p>If the library is hosted at a git repository, e.g.
<a href="https://github.com/GIT_USER_ID/GIT_REPO_ID">https://github.com/GIT_USER_ID/GIT_REPO_ID</a>
then install it via:</p>
<pre><code class="lang-shell">    npm install GIT_USER_ID/GIT_REPO_ID --save
</code></pre>
<h3 id="for-browser">For browser</h3>
<p>The library also works in the browser environment via npm and <a href="http://browserify.org/">browserify</a>. After following
the above steps with Node.js and installing browserify with <code>npm install -g browserify</code>,
perform the following (assuming <em>main.js</em> is your entry file):</p>
<pre><code class="lang-shell">browserify main.js &gt; bundle.js
</code></pre>
<p>Then include <em>bundle.js</em> in the HTML pages.</p>
<h3 id="webpack-configuration">Webpack Configuration</h3>
<p>Using Webpack you may encounter the following error: &quot;Module not found: Error:
Cannot resolve module&quot;, most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:</p>
<pre><code class="lang-javascript">module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
</code></pre>
<h2 id="getting-started">Getting Started</h2>
<p>Please follow the <a href="#installation">installation</a> instruction and execute the following JS code:</p>
<pre><code class="lang-javascript">var EmbyClientJavaScript = require('EmbyClient.JavaScript');
var defaultClient = EmbyClientJavaScript.ApiClient.instance;

// Configure API key authorization: apikeyauth
var apikeyauth = defaultClient.authentications['apikeyauth'];
apikeyauth.apiKey = &quot;YOUR API KEY&quot;
// Uncomment the following line to set a prefix for the API key, e.g. &quot;Token&quot; (defaults to null)
//apikeyauth.apiKeyPrefix['api_key'] = &quot;Token&quot;


var api = new EmbyClientJavaScript.ActivityLogServiceApi()
var opts = { 
  'startIndex': 56, // {Number} Optional. The record index to start at. All items with a lower index will be dropped from the results.
  'limit': 56, // {Number} Optional. The maximum number of records to return
  'minDate': &quot;minDate_example&quot; // {String} Optional. The minimum date. Format = ISO
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getSystemActivitylogEntries(opts, callback);
</code></pre>
<h2 id="documentation-links">Documentation Links</h2>
<p>For general documentation, please refer to <a href="../../../../doc/restapi/index.html">Accessing Emby Server via REST API</a>.</p>
<p>The available API endpoints are documented in the <a href="../../../../reference/RestAPI.html">REST API Reference</a> section.</p>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                </ul>
              </div>
              <div class="sdkversion Release">
                  SDK <span class="sdkVersionSpan"></span>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>On this Page</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to Top</a>
            </span>
            Copyright 2022 © EMBY LLC.  Please see our <a class="lnk" href="https://emby.media/terms.html">terms of use</a> and <a class="lnk" href="https://emby.media/privacy.html">privacy policy</a>.
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../../../../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../../../../searchIndex.js"></script>
    <script type="text/javascript" src="../../../../styles/lunr.min.js"></script>
    <script type="text/javascript" src="../../../../styles/docfx.js"></script>
    <script type="text/javascript" src="../../../../styles/main.js"></script>
  </body>
</html>
